package com.szd.qiongyou20.home.presenter;

import android.content.Context;

import com.szd.qiongyou20.home.bean.CityData;
import com.szd.qiongyou20.home.modle.LoadCityData;
import com.szd.qiongyou20.home.modle.LoadData;
import com.szd.qiongyou20.home.modle.LoadHomeData;
import com.szd.qiongyou20.home.view.CityDataToView;

/**
 * Created by SZD on 2016/12/22.
 */

public class CityPre {

    private LoadData mLoadData;
    private CityDataToView mCityDataToView;
    private String city_id;

    public CityPre(CityDataToView cityDataToView, String id) {
        mCityDataToView = cityDataToView;
        city_id = id;
        mLoadData = new LoadHomeData();
    }

    public void loadDataToView(Context context){
        mLoadData.CityData(context, city_id, new LoadCityData() {
            @Override
            public void loadDataSuccess(CityData cityData) {
                mCityDataToView.toView(cityData);
            }

            @Override
            public void loadDataFailed(String string) {

            }
        });
    }
}
